/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.yy.bugzillahelp.ui.detail;

import com.yy.bugzillahelp.data.BugCommentData;

/**
 *
 * @author hualun-alan
 */
public class BugCommentPanel extends javax.swing.JPanel {

    private BugCommentData commentData;

    /**
     * Creates new form BugCommentPanel
     */
    public BugCommentPanel() {
        initComponents();
    }

    public void setCommentData(BugCommentData commentData) {
        this.commentData = commentData;

        jlTime.setText(commentData.getWhen());
        jlReporter.setText(commentData.getWho());
        jtaComment.setText(commentData.getText());
    }

    /**
     * This method is called from within the constructor to initialize the form. WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jPanel1 = new javax.swing.JPanel();
        jButton1 = new javax.swing.JButton();
        jlReporter = new javax.swing.JLabel();
        jlTime = new javax.swing.JLabel();
        jpText = new javax.swing.JPanel();
        jScrollPane1 = new javax.swing.JScrollPane();
        jtaComment = new javax.swing.JTextArea();

        setLayout(new java.awt.BorderLayout());

        jPanel1.setPreferredSize(new java.awt.Dimension(400, 35));
        jPanel1.setLayout(new java.awt.FlowLayout(java.awt.FlowLayout.LEFT));

        jButton1.setText("+/-");
        jButton1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton1ActionPerformed(evt);
            }
        });
        jPanel1.add(jButton1);

        jlReporter.setPreferredSize(new java.awt.Dimension(100, 20));
        jPanel1.add(jlReporter);

        jlTime.setPreferredSize(new java.awt.Dimension(200, 20));
        jPanel1.add(jlTime);

        add(jPanel1, java.awt.BorderLayout.NORTH);

        jpText.setLayout(new java.awt.BorderLayout());

        jtaComment.setColumns(20);
        jtaComment.setLineWrap(true);
        jtaComment.setRows(10);
        jtaComment.setWrapStyleWord(true);
        jScrollPane1.setViewportView(jtaComment);

        jpText.add(jScrollPane1, java.awt.BorderLayout.CENTER);

        add(jpText, java.awt.BorderLayout.CENTER);
    }// </editor-fold>//GEN-END:initComponents

    private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed
        jpText.setVisible(!jpText.isVisible());
    }//GEN-LAST:event_jButton1ActionPerformed
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton jButton1;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JLabel jlReporter;
    private javax.swing.JLabel jlTime;
    private javax.swing.JPanel jpText;
    private javax.swing.JTextArea jtaComment;
    // End of variables declaration//GEN-END:variables
}
